package com.blb.service.impl;

import com.blb.entity.Classification;
import com.blb.entity.Notes;
import com.blb.mapper.ClassificationMapper;
import com.blb.service.IClassificationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yanghao
 * @since 2019-12-21
 */
@Service
public class ClassificationServiceImpl extends ServiceImpl<ClassificationMapper, Classification> implements IClassificationService {

    @Resource
    private ClassificationMapper classificationMapper;
    @Override
    public List<Classification> getAllClassification(String pid,String recycle,String userId) {
        return classificationMapper.getAllClassification(pid,recycle,userId);
    }

    @Override
    public List<Classification> getFolderByPid(String id,String recycle) {
        return classificationMapper.getFolderByPid(id,recycle);
    }

    @Override
    public List<Notes> getNoteByClassificationId(String classificationId) {
        return classificationMapper.getNoteByClassificationId(classificationId);
    }

    @Override
    public void updateMoveFolder(Classification classification) {
        classificationMapper.updateMoveFolder(classification);
    }

    @Override
    public void updateFolderName(Classification classification) {
        classificationMapper.updateFolderName(classification);
    }

    @Override
    public void updateRecycleById(String recycle,String id) {
        classificationMapper.updateRecycleById(recycle,id);
    }

  /*  @Override
    public List<Classification> getAllClassification(String pid) {
        return null;
    }*/

    @Override
    public List<Classification> getAllFolder(String pid,String userId,String recycle) {
        return classificationMapper.getAllFolder(pid,userId,recycle);
    }

    @Override
    public List<Notes> getAllNotes(String userId, String recycle) {
        return classificationMapper.getAllNotes(userId, recycle);
    }

    @Override
    public Notes getNoteById(String id) {
        return classificationMapper.getNoteById(id);
    }

    @Override
    public List<Notes> getAllNotesByClassId(String classificationId,String userId,String recycle) {
        return classificationMapper.getAllNotesByClassId(classificationId,userId,recycle);
    }

}
